﻿Ext.define('Gnt.examples.advanced.view.ChangeLog',
{
    extend: 'Ext.window.Window',
    autoScroll: true,
    modal: true,
    title: '变更记录',
    width: 600,
    height: 400,
    layout: 'fit',
    bodyStyle: 'padding:3px',
    initComponent: function () {
        var me = this;
        me.items = [me.getLogGrid()];
        me.callParent();
    },
    getLogGrid: function () {
        var me = this;
        if (!this.logGrid) {
            this.logGrid = new Ext.grid.Panel({
                viewConfig: {
                    enableTextSelection: true //可以复制单元格文字
                },
                store:new Ext.data.Store({
                    autoLoad: true,
                  //  remoteSort: true,
                    rootProperty: 'result',
                    proxy: {
                        type: 'ajax',
                        url: '/api/services/app/gantt/GetChangeLog?projectId=' + _projectId,
                        reader: {
                            type: 'json',
                            rootProperty: 'result'
                        }
                    },
                }),
                multiColumnSort: true,
                forceFit: true,
                columns: [
                    { header: '描述', dataIndex: 'note' },
                    { header: '变更人', dataIndex: 'createBy' },
                    {
                        header: '变更时间', dataIndex: 'createOn'
                    }
                ]
            });
        }
        return this.logGrid;
    }
});